<template>
  <el-dialog :visible.sync="visible" v-dialogDrag :title="title" class="tl-dialog" width="1200px" @open="open" @close="close" top="10px" :append-to-body="true" :modal-append-to-body="true">
    <div style="padding-bottom:10px">
      <!-- 查询界面 -->
      <tl-list-search ref="search" :query-param="queryParam" @search="doQuery" :isDisplayDefaultSearch="false">
        <template slot="search">
          <el-form-item label="编码" prop="code">
            <el-input v-model="queryParam.qry_code" placeholder=""></el-input>
          </el-form-item>
          <el-form-item label="名称">
            <el-input v-model="queryParam.qry_name" placeholder=""></el-input>
          </el-form-item>
        </template>
      </tl-list-search>
      <!-- 列表界面 -->
      <div>
        <!-- 列表选择 -->
        <div class="table-alert-div" ref="selector">
          <el-alert type="success" :closable="false" class="tl-table-alert-info" effect="light">
            <template slot="title">
              已选择&nbsp;<a class="tl-table-alert-info-a1">{{ selectedRows.length }}</a
              >项&nbsp;&nbsp;
              <a class="tl-table-alert-info-a2" @click="doClearSelected">全部清空</a>
            </template>
          </el-alert>
        </div>
        <!--表格渲染-->
        <el-table class="tl-table" ref="mainTable" :height="tableHeight" v-loading="loading" :data="datas" @selection-change="doSelectChange" @sort-change="doSortChange" @row-dblclick="doRowDbClick" row-key="id" border fit :row-class-name="doChangeRowClassName">
          <el-table-column type="selection" width="55px" fixed="left" v-if="isSingleSelect === false "> </el-table-column>
					<el-table-column prop="name" label="会议主题" width="150px" sortable="custom" sort-by="name" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="disptype" label="会议类型" width="100px" sortable="custom" sort-by="type" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="content" label="会议内容" width="150px" sortable="custom" sort-by="content" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="place" label="会议地点" width="150px" sortable="custom" sort-by="place" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="room" label="会议室" width="150px" sortable="custom" sort-by="room" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="begintime" label="会议开始时间" width="170px" sortable="custom" sort-by="begintime" align="center" header-align="center" :formatter="dateTimeFormat" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="endtime" label="会议结束时间" width="170px" sortable="custom" sort-by="endtime" align="center" header-align="center" :formatter="dateTimeFormat" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="deptid" label="会议部门id" width="150px" sortable="custom" sort-by="deptid" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="deptname" label="会议部门名称" width="150px" sortable="custom" sort-by="deptname" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="dispreminderfrequency" label="提醒频率" width="100px" sortable="custom" sort-by="reminderfrequency" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="attenduserids" label="参会人员id" width="120px" sortable="custom" sort-by="attenduserids" align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="attendusercodes" label="参会人员工号" width="150px" sortable="custom" sort-by="attendusercodes" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="attendusernames" label="参会人员姓名" width="150px" sortable="custom" sort-by="attendusernames" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="dispshareusercodes" label="分享人员工号" width="100px" sortable="custom" sort-by="shareusercodes" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="shareusernames" label="分享人员姓名" width="150px" sortable="custom" sort-by="shareusernames" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="dispsharedeptcodes" label="分享部门编号" width="100px" sortable="custom" sort-by="sharedeptcodes" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="sharedeptnames" label="分享部门名称" width="150px" sortable="custom" sort-by="sharedeptnames" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="shareroleids" label="分享角色" width="150px" sortable="custom" sort-by="shareroleids" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="dispstate" label="状态" width="100px" sortable="custom" sort-by="state" align="center" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="description" label="备注" min-width="250px" align="left" header-align="center" :show-overflow-tooltip="true"></el-table-column>
					<el-table-column prop="enabled" label="有效" width="100px" sortable="custom" sort-by="enabled" align="center" header-align="center">
						<template slot-scope="scope">
							<el-tag v-if="scope.row.enabled === 1" type="success">是</el-tag>
							<el-tag v-else type="danger">否</el-tag>
						</template>
					</el-table-column>
          <el-table-column label="操作" width="80px" align="center" fixed="right" v-if="isSingleSelect === true">
            <template slot-scope="scope">
              <el-button type="text" icon="el-icon-finished" @click="doSelectData(scope.row[fieldDefaultKey])">选择</el-button>
            </template>
          </el-table-column>
        </el-table>
        <!-- 列表分页 -->
        <el-row class="pagebar" ref="pager">
          <el-pagination @size-change="doChangeSize" @current-change="doChangeIndex" :current-page="pageInfo.currentPage" :page-sizes="pageInfo.pageSizes" :total="pageInfo.totalCount" layout="total, sizes, prev, pager, next, jumper" background class="tl-table-pagination"> </el-pagination>
        </el-row>
      </div>
    </div>
    <div slot="footer" class="dialog-footer" v-if="isSingleSelect === false">
      <el-button type="text" @click="doCancelEdit">取消</el-button>
      <el-button type="primary" @click="doConfirm">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
/** mixins */
import { mixin_ref_list } from '@tapui/mixins/mixin_ref_list'
/** 子组件 */
/** 工具类 */
import { queryDataCode } from '@tapui/api/dataCode'
import { getAction, putAction, postAction } from '@tapui/utils/http'
/** VUE配置 */
export default {
  name: 'TlMeetManageRef',
  components: {},
  mixins: [mixin_ref_list],
  data() {
    return {
      description: '会议管理参照页面',
      // 默认Key字段名
      fieldDefaultKey: 'id',
      // 默认显示字段名
      fieldDefaultValue: 'name',
      // url配置
      url: {
        list: '/meet/meetManage/refList'
      },
      // 排序参数
      sorterInfo: {
        sidx: 'sortcode',
        sord: 'asc'
      }
    }
  },
  methods: {}
}
</script>

